package com.qfmy.app.config;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * 线程池配置
 */
public class ThreadPoolConfig {
    // 自定义线程池
    public static ExecutorService executorService = new ThreadPoolExecutor(
        10, // 核心线程数
        50, // 最大线程数
        60, // 空闲线程存活时间
        TimeUnit.SECONDS,
        new java.util.concurrent.LinkedBlockingQueue<>(100), // 队列大小
        new ThreadPoolExecutor.CallerRunsPolicy() // 拒绝策略
    );
}